Skip to main content

All Questions

4votes
2answers
1kviews

How to organize a chain of functions that share parameters, functional programming

When trying to follow a functional programming paradigm, I often find myself in a situation where I have a chain of functions that I would want to combine/compose somehow, but they all also take in a ...
Cordello's user avatar
12votes
6answers
2kviews

Best Practice - Wrapping if around function call vs Adding early exit if guard in function

I know this can be very use-case specific, but I find myself wondering this far too often. Is there a generally preferred syntax. I'm not asking what is the best approach when in a function, I am ...
Matthew Mullin's user avatar
2votes
1answer
639views

Should all functions be fully self-contained (is it bad practice to share a variable between functions)?

There are two ways to do the same thing (pseudo code) Define databaseHandle in the parent function, and use it as a global in this scope: function API() { function openDatabase() { return ...
CodeVirtuoso's user avatar

close